This disclosure relates generally to data processing, and more particularly, to software development, including techniques for facilitating debugging a computer program.
The development of a computer program includes creating source code, which may include many thousands of lines of instructions. The source code is converted into an executable program or machine code using a compiler. A software application typically includes a collection of programs that perform particular tasks.
Computer programs, especially new ones, typically contain errors, commonly referred to as “bugs.” Debugging involves testing and evaluating the computer program to find and correct errors. A programmer may use a computer program, commonly referred to as a “debugger” to assist in debugging a program.
A group of computer program instructions, while being executed, may be referred to as a “process.” Several processes may be associated with a program while it is running. A process may include two or more threads. A thread is the smallest set of instructions that can be managed independently by an operating system scheduler. Threads within the same process may share resources and context, e.g., memory, instructions, and variable values, while threads of different processes do not share resources.
A debugger allows the programmer to execute a computer program under the control of the debugger, allowing a process to be monitored. The order in which instructions are executed and values that variables are changed to may be tracked during program execution. Among other features, debuggers typically support breakpoint and step operations. A “breakpoint” function permits a programmer to set a breakpoint at a particular instruction or line. Program instructions are executed until the instruction with the breakpoint is reached. Execution of the program is paused at the instruction immediately preceding the breakpoint instruction and the values of variables at the breakpoint instruction may be presented to the programmer for analysis. A “step” function permits a programmer to execute instructions of a computer program one at a time and view values of variables at the completion of each instruction.
Typically, it is not practical to step through many thousands of lines of instructions of a program from beginning to end using the step function. Commonly, a programmer will set a breakpoint at a particular instruction and once the breakpoint is reached, the step function is then used to step through a few of the lines immediately following the breakpoint.